home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ComCtrls, StdCtrls, Menus, ExtCtrls, People, ShellAPI,
-
- // TExportListView Units
- ExportLView, ELV_Main;
-
- type
- TForm1 = class(TForm)
- ExportListView1: TExportListView;
- MainMenu1: TMainMenu;
- File1: TMenuItem;
- Print1: TMenuItem;
- PrintSetup1: TMenuItem;
- N1: TMenuItem;
- Exit1: TMenuItem;
- PrinterSetupDialog1: TPrinterSetupDialog;
- Panel1: TPanel;
- PageControl1: TPageControl;
- TabSheet4: TTabSheet;
- TabSheet5: TTabSheet;
- TabSheet2: TTabSheet;
- ListView1: TListView;
- Button1: TButton;
- Button2: TButton;
- Button3: TButton;
- Bevel1: TBevel;
- Shape2: TShape;
- Label2: TLabel;
- Shape3: TShape;
- Label5: TLabel;
- Shape4: TShape;
- Label8: TLabel;
- Label9: TLabel;
- Label10: TLabel;
- Label11: TLabel;
- Label6: TLabel;
- TabSheet1: TTabSheet;
- Shape1: TShape;
- Label1: TLabel;
- Shape6: TShape;
- Label3: TLabel;
- Button4: TButton;
- Button5: TButton;
- procedure PrintSetup1Click(Sender: TObject);
- procedure Print1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Label8Click(Sender: TObject);
- procedure Label9Click(Sender: TObject);
- procedure Button5Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- // *** Print Code ***
-
- procedure TForm1.PrintSetup1Click(Sender: TObject);
- begin
- // Print Setup
- PrinterSetupDialog1.Execute;
- end;
-
- procedure TForm1.Print1Click(Sender: TObject);
- begin
- // Print
- ExportListView1.Print;
- end;
-
- // *** Demo 1 Code
-
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- // Let User choose the Export Type
- ExportListView1.Choose;
- end;
-
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- // Ignore this, it's just my Random People Generator (tm)
- GeneratePeople(ListView1);
- end;
-
- // *** Demo 2 Code ***
-
- procedure TForm1.Button5Click(Sender: TObject);
- begin
- with ExportListView1 do
- begin
- ExportType := xMicrosoft_Word;
- Options := Options + [NumberRows]; // We Want Row Numbering
- ViewOnly := True; // Export to Screen
- Execute; // Do Export
- end;
- end;
-
- procedure TForm1.Button4Click(Sender: TObject);
- begin
- with ExportListView1 do
- begin
- ExportType := xMicrosoft_Word;
- Options := Options + [NumberRows]; // We Want Row Numbering
- ViewOnly := False; // Export to Screen
- ExportFile := ''; // Ensure it's blank, so we get a file dialog
- Execute; // Do Export
- end;
- end;
-
- // *** Please Ignore
-
- procedure TForm1.Label8Click(Sender: TObject);
- begin
- // Visit our Web Page
- ShellExecute(0, PChar('open'), PChar(cComponentsWebSite), PChar(''), PChar(''), SW_SHOWNORMAL);
- end;
-
- procedure TForm1.Label9Click(Sender: TObject);
- begin
- // Send us E-mail
- ShellExecute(0, PChar('open'), PChar(cComponentsMailto), PChar(''), PChar(''), SW_SHOWNORMAL);
- end;
-
- end.
-